package MySwing;
import javax.swing.JLabel;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;

@SuppressWarnings("serial")
public class JFormNumberField extends JFormComponent {
	 SpinnerNumberModel numberModel;
	 JSpinner numberChooser;
	 JLabel textLabel;
	public JFormNumberField(String nombre,int defaultValue,int minimo,int maximo, int step)
	{
		numberModel = new SpinnerNumberModel(
	               new Integer(defaultValue), 
	               new Integer(minimo), 
	               new Integer(maximo), 
	               new Integer(step) 
	               );
		numberChooser = new JSpinner(numberModel);
		textLabel = new JLabel();
		textLabel.setText(nombre);
		addComponent();
	}
	protected void addComponent() {
		add(textLabel);
		add(numberChooser);
	}
	public JSpinner getSpinner()
	{
		return numberChooser;
	}
}
